#pragma once

#include <glm/glm.hpp>
#include <limits>

constexpr float infinity = std::numeric_limits<float>::infinity();

class Ray final {
 public:
  Ray() = default;
  Ray(glm::vec3 origin, glm::vec3 direction)
      : mOrigin(std::move(origin)), mDirection(std::move(direction)) {}

  ~Ray() = default;

  const glm::vec3 &Origin() const { return mOrigin; }

  const glm::vec3 &Direction() const { return mDirection; }

  glm::vec3 At(float t) const;

  static glm::vec3 RayColor(const Ray &ray);

  static glm::vec3 Refract(const glm::vec3 &uv, const glm::vec3 &n,
                           float etai_over_etat);

 private:
  glm::vec3 mOrigin = {};
  glm::vec3 mDirection = {};
};
